<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
	<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
	<TITLE></TITLE>
	<META NAME="GENERATOR" CONTENT="OpenOffice.org 3.2  (Unix)">
	<META NAME="CREATED" CONTENT="0;0">
	<META NAME="CHANGED" CONTENT="20101227;15060400">
	<STYLE TYPE="text/css">
	<!--
		@page { size: 8.27in 11.69in }
	-->
	</STYLE>
</HEAD>
<BODY LANG="en-US" DIR="LTR">
<P><BR><BR>
</P>
<P STYLE="text-decoration: none"><FONT SIZE=6 STYLE="font-size: 22pt"><B>integral</B></FONT></P>
<P>Evaluate the integral 
</P>
<P>\int_{a}^{b} \frac{10}{x^2} dx</P>
<P><BR><BR>
</P>
<P>Example: Can be run with F5 within the ScalaLab Editor (Ctrl-E to
open the editor)</P>
<P><A NAME="__DdeLink__1_1363190756"></A><A NAME="__DdeLink__4_1376639203"></A>
<BR><BR>
</P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">import
java.text.DecimalFormat;</FONT></P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">import numal.*;</FONT></P>
<P><BR><BR>
</P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">public class Test_integral
extends Object implements AE_integral_method {</FONT></P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">public static void
main(String args[]) {</FONT></P>
<P><BR><BR>
</P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">boolean ua,ub;</FONT></P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">int i;</FONT></P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">double a;</FONT></P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">double e[] = new double[7];</FONT></P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">double b[]={2.0, 4.0, 20.0,
100.0};</FONT></P>
<P><BR><BR>
</P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">Test_integral testintegral =
new Test_integral();</FONT></P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">DecimalFormat fiveDigit = new
DecimalFormat(&quot;0.00000E0&quot;);</FONT></P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">System.out.println(&quot;INTEGRAL
delivers:&quot;);</FONT></P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">ua=true;</FONT></P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">e[1]=e[2]=1.0e-6;</FONT></P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">for (i=0; i&lt;=3; i++) {</FONT></P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">ub=(b[i] &lt; 50.0);</FONT></P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">a=Analytic_eval.integral(-1.0,-b[i],testintegral,e,ua,ub);</FONT></P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">System.out.println(&quot; &quot;
+ fiveDigit.format(a) + &quot;\t&quot; + (int)e[3] +</FONT></P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">&quot;\t&quot; +
fiveDigit.format(e[4]) + &quot;\t&quot; + e[5] + &quot;\t&quot; +
e[6]);</FONT></P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">ua=false;</FONT></P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">}</FONT></P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">}</FONT></P>
<P><BR><BR>
</P>
<P><BR><BR>
</P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">public double fx(double x) {</FONT></P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">return 10.0/(x*x);</FONT></P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">}</FONT></P>
<P><BR><BR>
</P>
<P><FONT SIZE=2 STYLE="font-size: 11pt">}</FONT></P>
</BODY>
</HTML>